using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;

namespace Unity.Per.Common.WebRPC
{
    public class WebRPCUploadFile :BaseWebRPC
    {
        public string uploadfilePath;

        public WebRPCUploadFile(string url, string uploadfilePath,bool AddToken = true) : base(url, UnityWebRequest.kHttpVerbPOST, AddToken) {
            this.uploadfilePath = uploadfilePath;

            byte[] fileByte = File.ReadAllBytes(uploadfilePath);
            SetForm(new MultipartFormFileSection("file", fileByte, Path.GetFileName(uploadfilePath), "application/msword"));
        }


    }
}
